package a.e.b.a;

import a.e.a.db;
import a.e.b.c.a;
import a.e.b.c.cb;
import a.e.b.c.eb;
import a.e.b.c.o;
import a.f.fd;
import a.f.hd;
import a.f.id;
import a.j.ig;
import a.j.re;

import java.util.Map;

public class v
  implements a.e.b.c.v
{
  static final Map a = db.c;
  static final Map b = db.b;
  static final Map c = db.d;
  static final String d = "anywhere";
  static final String e = "source";
  static final String f = "target";
  static final String g = "center";
  static final String h = "on_edge";
  static final String i = "left";
  static final String j = "right";
  static final String k = "relative_to_edge_flow";
  static final String l = "absolute_left_in_north";
  static final String n = "absolute_right_in_north";
  static final String o = "absolute";
  static final String p = "relative_to_edge_flow";
  static final String q = "co";
  static final String r = "counter";
  static final String s = "0";
  static final String t = "180";
  public static int u;
  
  public void a(eb parameb)
    throws a
  {
    Object localObject = parameb.a();
    if ((i.i) || ((localObject instanceof ig)))
    {
      ig localig = (ig)localObject;
      parameb.e().a("EdgeLabel", "http://www.yworks.com/xml/graphml");
      a(localig, parameb.e(), parameb.d());
      parameb.e().b();
      parameb.a(true);
    }
  }
  
  protected void a(ig paramig, cb paramcb, o paramo)
    throws a
  {
    boolean bool = i.i;
    String str1 = b(paramig, paramo);
    if (str1 != null) {
      paramcb.c("modelName", str1);
    }
    if (127 != paramig.D())
    {
      localObject = c(paramig, paramo);
      if (bool) {
        break label82;
      }
      if (localObject != null) {
        paramcb.c("modelPosition", (String)localObject);
      }
    }
    Object localObject = a(paramig, paramo);
    if (!bool)
    {
      if (localObject != null) {
        label82:
        paramcb.c("preferredPlacement", localObject.toString());
      }
      paramcb.a("distance", paramig.cb());
      paramcb.a("ratio", paramig.eb());
      y.a(paramcb, paramig, paramo);
    }
    String str2 = paramig.H();
    if ((bool) || (str2 != null)) {
      if (!bool)
      {
        if (str2.length() > 0)
        {
          paramcb.c(str2);
          if (bool) {
            return;
          }
        }
      }
      else {
        if (i.h == 0) {
          break label190;
        }
      }
    }
    paramcb.a("hasText", false);
    label190:
    b(paramig, paramcb, paramo);
    c(paramig, paramcb, paramo);
  }
  
  protected void b(ig paramig, cb paramcb, o paramo)
    throws a
  {
    if (127 == paramig.D())
    {
      paramcb.a("LabelModel", "http://www.yworks.com/xml/graphml");
      paramo.b(paramig.a());
      paramcb.b();
      paramcb.a("ModelParameter", "http://www.yworks.com/xml/graphml");
      paramo.b(paramig.e());
      paramcb.b();
    }
  }
  
  protected void c(ig paramig, cb paramcb, o paramo)
    throws a
  {
    paramo.b(paramig.b());
  }
  
  protected Object a(ig paramig, o paramo)
  {
    return c.get(new Byte(paramig.db()));
  }
  
  protected String b(ig paramig, o paramo)
  {
    if (127 == paramig.D()) {
      return "custom";
    }
    return (String)b.get(new Byte(paramig.D()));
  }
  
  protected String c(ig paramig, o paramo)
  {
    return (String)a.get(new Byte(paramig.C()));
  }
  
  public static class a_
    implements a.e.b.c.v
  {
    private static final String a = "|";
    public static int b;
    
    public void a(eb parameb)
      throws a
    {
      Object localObject = parameb.a();
      if (!i.i)
      {
        if ((localObject instanceof fd)) {
          a((fd)localObject, parameb.e(), parameb.d());
        }
      }
      else {
        parameb.a(true);
      }
    }
    
    protected void a(fd paramfd, cb paramcb, o paramo)
    {
      paramcb.a("PreferredPlacementDescriptor", "http://www.yworks.com/xml/graphml");
      paramcb.c("placement", a(paramfd.a()));
      paramcb.c("side", b(paramfd.b()));
      paramcb.c("sideReference", c(paramfd.c()));
      paramcb.a("angle", paramfd.d());
      paramcb.c("angleReference", d(paramfd.e()));
      paramcb.c("angleRotationOnRightSide", e(paramfd.f()));
      paramcb.c("angleOffsetOnRightSide", f(paramfd.g()));
      paramcb.a("distance", paramfd.h());
      if (!i.i)
      {
        if (paramfd.z()) {
          paramcb.a("frozen", true);
        }
        paramcb.b();
      }
    }
    
    private static String a(byte paramByte)
    {
      if (!i.i) {
        if (paramByte == 0) {
          return "anywhere";
        }
      }
      return a(paramByte, new byte[] { 1, 2, 4 }, new String[] { "source", "target", "center" });
    }
    
    private static String b(byte paramByte)
    {
      if (!i.i) {
        if (paramByte == 0) {
          return "anywhere";
        }
      }
      return a(paramByte, new byte[] { 8, 16, 32 }, new String[] { "on_edge", "left", "right" });
    }
    
    private static String c(byte paramByte)
    {
      return a(paramByte, new byte[] { 1, 2, 4 }, new String[] { "relative_to_edge_flow", "absolute_left_in_north", "absolute_right_in_north" });
    }
    
    private static String d(byte paramByte)
    {
      return a(paramByte, new byte[] { 1, 2 }, new String[] { "absolute", "relative_to_edge_flow" });
    }
    
    private static String e(byte paramByte)
    {
      return a(paramByte, new byte[] { 1, 2 }, new String[] { "co", "counter" });
    }
    
    private static String f(byte paramByte)
    {
      return a(paramByte, new byte[] { 1, 2 }, new String[] { "0", "180" });
    }
    
    private static String a(byte paramByte, byte[] paramArrayOfByte, String[] paramArrayOfString)
    {
      boolean bool = i.i;
      int k = i.h;
      String str = "";
      StringBuffer localStringBuffer = new StringBuffer();
      int i = 0;
      int j = paramArrayOfByte.length;
      if (i < j) {
        if (!bool) {
          if ((paramByte & paramArrayOfByte[i]) == paramArrayOfByte[i]) {
            localStringBuffer.append(str).append(paramArrayOfString[i]);
          }
        }
      }
      while (bool)
      {
        str = "|";
        i++;
        if (k == 0) {
          break;
        }
      }
      return localStringBuffer.toString();
    }
  }
  
  public static class d_
    implements a.e.b.c.v
  {
    public static boolean a;
    
    public void a(eb parameb)
      throws a
    {
      boolean bool = i.i;
      Object localObject = parameb.a();
      if (!bool) {
        if ((localObject instanceof re))
        {
          a((re)localObject, parameb.e(), parameb.d());
          parameb.a(true);
        }
      }
      if ((bool) || ((i.h != 0) && ((localObject instanceof re.a_))))
      {
        a((re.a_)localObject, parameb.e(), parameb.d());
        parameb.a(true);
      }
    }
    
    protected void a(re.a_ parama_, cb paramcb, o paramo)
    {
      paramcb.a("SmartEdgeLabelModelParameter", "http://www.yworks.com/xml/graphml");
      paramcb.a("segment", parama_.a());
      paramcb.a("ratio", parama_.b());
      paramcb.a("distance", parama_.c());
      paramcb.a("distanceToCenter", parama_.d());
      paramcb.c("position", a(parama_.e()));
      paramcb.a("angle", parama_.f());
      paramcb.b();
    }
    
    protected void a(re paramre, cb paramcb, o paramo)
    {
      paramcb.a("SmartEdgeLabelModel", "http://www.yworks.com/xml/graphml");
      paramcb.a("defaultAngle", paramre.e());
      paramcb.a("defaultDistance", paramre.f());
      paramcb.a("autoRotationEnabled", paramre.c());
      if (!i.i)
      {
        if (paramre.d()) {
          paramcb.a("autoFlippingEnabled", true);
        }
        paramcb.b();
      }
    }
    
    private static String a(byte paramByte)
    {
      if (!i.i) {
        switch (paramByte)
        {
        case 0: 
          return "center";
        case 2: 
          return "left";
        case 1: 
          return "right";
        }
      }
      return Byte.toString(paramByte);
    }
  }
  
  public static class c_
    implements a.e.b.c.v
  {
    public static boolean a;
    
    public void a(eb parameb)
      throws a
    {
      boolean bool = i.i;
      Object localObject = parameb.a();
      if (!bool) {
        if ((localObject instanceof id))
        {
          a((id)localObject, parameb.e(), parameb.d());
          parameb.a(true);
        }
      }
      if ((bool) || ((i.h != 0) && ((localObject instanceof id.a_))))
      {
        a((id.a_)localObject, parameb.e(), parameb.d());
        parameb.a(true);
      }
    }
    
    protected void a(id.a_ parama_, cb paramcb, o paramo)
    {
      paramcb.a("RotatedSliderEdgeLabelModelParameter", "http://www.yworks.com/xml/graphml");
      paramcb.a("ratio", parama_.b());
      paramcb.a("segment", parama_.a());
      paramcb.a("invertingSign", parama_.c());
      paramcb.b();
    }
    
    protected void a(id paramid, cb paramcb, o paramo)
    {
      paramcb.a("RotatedSliderEdgeLabelModel", "http://www.yworks.com/xml/graphml");
      paramcb.a("angle", paramid.g());
      paramcb.a("autoRotationEnabled", paramid.e());
      if (!i.i)
      {
        if (paramid.f()) {
          paramcb.a("autoFlippingEnabled", true);
        }
        paramcb.a("distance", paramid.d());
        paramcb.a("distanceRelativeToEdge", paramid.c());
        paramcb.c("mode", a(paramid.b()));
        paramcb.b();
      }
    }
    
    private static String a(byte paramByte)
    {
      if (!i.i) {
        switch (paramByte)
        {
        case 0: 
          return "center_slider";
        case 1: 
          return "side_slider";
        case 2: 
          return "single_side_slider";
        }
      }
      return Byte.toString(paramByte);
    }
  }
  
  public static class b_
    implements a.e.b.c.v
  {
    public static boolean a;
    
    public void a(eb parameb)
      throws a
    {
      boolean bool = i.i;
      Object localObject = parameb.a();
      if (!bool) {
        if ((localObject instanceof hd))
        {
          a((hd)localObject, parameb.e(), parameb.d());
          parameb.a(true);
        }
      }
      if ((bool) || ((i.h != 0) && ((localObject instanceof hd.a_))))
      {
        a((hd.a_)localObject, parameb.e(), parameb.d());
        parameb.a(true);
      }
    }
    
    protected void a(hd.a_ parama_, cb paramcb, o paramo)
    {
      paramcb.a("RotatedDiscreteEdgeLabelModelParameter", "http://www.yworks.com/xml/graphml");
      paramcb.c("position", a(parama_.a()));
      paramcb.b();
    }
    
    private static String a(int paramInt)
    {
      if (!i.i) {
        switch (paramInt)
        {
        case 1: 
          return "shead";
        case 2: 
          return "head";
        case 4: 
          return "thead";
        case 8: 
          return "stail";
        case 16: 
          return "tail";
        case 32: 
          return "ttail";
        case 64: 
          return "scenter";
        case 128: 
          return "center";
        case 256: 
          return "tcenter";
        }
      }
      return Integer.toString(paramInt);
    }
    
    protected void a(hd paramhd, cb paramcb, o paramo)
    {
      paramcb.a("RotatedDiscreteEdgeLabelModel", "http://www.yworks.com/xml/graphml");
      paramcb.a("angle", paramhd.f());
      paramcb.a("autoRotationEnabled", paramhd.d());
      if (!i.i)
      {
        if (paramhd.e()) {
          paramcb.a("autoFlippingEnabled", true);
        }
        paramcb.a("candidateMask", paramhd.b());
        paramcb.a("distance", paramhd.g());
        paramcb.a("positionRelativeToSegment", paramhd.c());
        paramcb.b();
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.b.a.v

 * JD-Core Version:    0.7.0.1

 */